package com.algorithm.eg1;

public class Solution {
  public static void printAllConditions() {
    int state = 593;
    while (state <= 2338) {
      System.out.print("[A(");
      System.out.print(horizontal(state >> 9));
      System.out.print(vertical(state >> 6));
      System.out.print("), B(");
      System.out.print(horizontal(state >> 3));
      System.out.print(vertical(state) + 7);
      System.out.println(")]");


    }
  }

  private static int vertical(int state) {
    int num = state % 8;
    switch (num) {
      default:
      case 1:
        return 1;
      case 2:
        return 2;
      case 4:
        return 4;
    }
  }

  private static char horizontal(int state) {
    int num = state % 8;
    switch (num) {
      default:
      case 1:
        return 'f';
      case 2:
        return 'e';
      case 3:
        return 'd';
    }
  }
}
